package keter.web.servlet;

import javax.servlet.ServletContext;
import javax.servlet.ServletRegistration;

import org.springframework.web.WebApplicationInitializer;

import com.alibaba.druid.support.http.StatViewServlet;

/**
 *  自定义servlet加载器
 *
 * @author  gulixing@msn.com
 * @date    2015年12月26日
 */
public class ServletsInitializer implements WebApplicationInitializer {
    @Override
    public void onStartup(ServletContext container) {
    	    	
        /* 前台自定义路由处理 */
//        ServletRegistration.Dynamic routesRegistration = 
//                container.addServlet("routes", new RoutesServlet());
//        routesRegistration.addMapping("/routes/*");       
        
        /* 连接池性能统计 */
        ServletRegistration.Dynamic druidRegistration = 
        		container.addServlet("druidStatView", new StatViewServlet());
        druidRegistration.addMapping("/druid/*");
        
        /* 微信公众平台模块 */
//        ServletRegistration.Dynamic wxRegistration = 
//                container.addServlet("wx", new WxServlet());
//        wxRegistration.addMapping("/wx");
    }
}